#include "readfile.h"
void readfile(fstream & f)
{
    for(int i = 0; i < ct; i++)
        delete pc[i];
    ct = 0;
    if(f.eof()) f.clear();
    f.seekg(0);
    enum classkind{Employee = 1, Manager, Fink, Highfink};
    int classtype;
    char ch;
    while((f >> classtype).get(ch))
    {
        switch(classtype)
        {
            case Employee : pc[ct] = new employee; pc[ct]->GetAll(f); break;
            case Manager : pc[ct] = new manager; pc[ct]->GetAll(f); break;
            case Fink : pc[ct] = new fink; pc[ct]->GetAll(f); break;
            case Highfink : pc[ct] = new highfink; pc[ct]->GetAll(f); break;
        }
        ct++;
    }
}
